@import "../../styles/index";
.prefixes(@property, @value) {
    -webkit-@{property}: @value;
     -khtml-@{property}: @value;
       -moz-@{property}: @value;
        -ms-@{property}: @value;
            @{property}: @value;
}
@transition: .18s;
.dnn-day-picker {
    float: left;
    width: auto;
    height: 30px;
    box-sizing: border-box;
    position: relative;
    &.has-outside-controle {
        width: 0;
        height: 0;
        border: none;
    }
    .calendar-container {       
        position: absolute;
        width: 256px;
        left: 0px;
        border: 1px solid var(--dnn-color-foreground-light, @alto);
        box-shadow: 0px 0px 17px 2px rgba(var(--dnn-color-foreground-r, 0), var(--dnn-color-foreground-g, 0), var(--dnn-color-foreground-b, 0), .2);
        opacity: 0;
        pointer-events: none;
        transition: 300ms;
        transform-origin: 100% 0% 0px;
        transform: scale(1);
        z-index: 10;
        background: var(--dnn-color-background, white);
        text-align: center;

        &.show-above-input {
            bottom: calc(100%);
            top: auto; // needed for old version compatibility
        }

        &.show-below-input {
            top: calc(100% + 12px);
        }

        &.invisible {
            * {
                pointer-events: none !important;
            }
        }
        & > div {
            width: 256px;
            float: left;
        }
        &.visible  {
            opacity: 1;
            pointer-events: all;
        }        
    }
    .calendar-icon {
        width: 30px;
        height: 30px;
        cursor: pointer;
        float: left;
        padding-top: 1px;
        color: var(--dnn-color-neutral, @alto);
        margin-left: 7px;
        &:hover, &:active {
            color: var(--dnn-color-primary, @curiousBlue);
        }
    }
    .clear-button {
        color: var(--dnn-color-neutral, @alto);
        cursor: pointer;
        height: 9px;
        position: absolute;
        left: 5px;
        top: 3px;
        font-size: 26px;
        &:hover {
            color: var(--dnn-color-neutral-dark, @rollingStone);
        }
    }
    .calendar-text {
        border: 1px solid var(--dnn-color-foreground-light, #b0afae);
        border-radius: var(--dnn-controls-radius, 0);
        padding: 8px 12px;
        cursor: pointer;
        min-height: 16px;
        text-align: right;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        float: left;
        width: 204px;
        position: relative;
        &.with-time-picker {
            padding-right: 40px;
        }
        div, span {
            float: left;
            }
    }
    .DayPicker {
        float: left;
        width: 240px;
        margin: 8px;
        outline: 0 !important;
        &, * {
            .prefixes(user-select, none);
        }
        .DayPicker-NavBar {
            position: relative;
            width: 100%;
        }
        .DayPicker-NavButton {
            position: absolute;
            display: block;
            cursor: pointer;
            border: 1px solid var(--dnn-color-neutral, #ccc);
            padding: 0;
            width: 28px;
            height: 28px;
            border-radius: 3px;
            text-indent: 30px;
            white-space: nowrap;
            overflow: hidden;
            background-color: transparent;
            background-position: center center;
            background-repeat: no-repeat;
            opacity: .5;
            &:hover {
                opacity: 1;
            }
            &.DayPicker-NavButton--prev {
                left: 2px;
                background-image: url(./img/leftBlack.png);
            }
            &.DayPicker-NavButton--next {
                right: 2px;
                background-image: url(./img/rightBlack.png);
            }
        }
        .DayPicker-Caption {
            width: 100%;
            text-align: center;
            text-transform: uppercase;
            padding: 10px 0;
            font-weight: 600;
            color: var(--dnn-color-foreground, @bulgarianRose);
        }
        .DayPicker-Weekdays {
            width: 100%;
            float: left;
            .DayPicker-WeekdaysRow {
                width: 100%;
                float: left;
                .DayPicker-Weekday {
                    color: var(--dnn-color-background, #fff);
                    line-height: 30px;
                    text-align: center;
                    background-color: @alto;
                    width: 14.28%;
                    box-sizing: border-box;
                    float: left;
                    border: 2px solid var(--dnn-color-background, #fff);
                }
            }
        }
        .DayPicker-Week {
            width: 100%;
            float: left;
        }
        .DayPicker-Day {
            width: 14.28%;
            float: left;
            height: 32px;
            cursor: pointer;
            display: block;
            padding: 6px 0 6px 0;
            color: var(--dnn-color-neutral, @rollingStone);
            font-size: 11px;
            font-family: inherit;
            line-height: 15px;
            text-align: center;
            background: var(--dnn-color-background, @mercury);
            box-sizing: border-box;
            border: 2px solid var(--dnn-color-background, #fff);
            outline: 0 !important;
            &.DayPicker-Day--selected {
                background: var(--dnn-color-primary, @curiousBlue) !important;
                color: var(--dnn-color-primary-contrast, #fff);
            }
            &.DayPicker-Day--outside {
                opacity: 0;
                pointer-events: none;
            }
            &.DayPicker-Day--disabled {
                pointer-events: none;
                cursor: default;
                color: var(--dnn-color-neutral, #999);
                opacity: .3;
            }
            &:hover {
                background: var(--dnn-color-neutral-light, @alto);
            }
        }
    }
    button[role="primary"] {
        float: right;
        margin: 10px;
        background: var(--dnn-color-primary, @curiousBlue);
        color: var(--dnn-color-primary-contrast, white);
        padding: 9px 20px;
        border: none;
        border-radius: 4px;
        cursor: pointer;
        &:hover, &:active {
            background: var(--dnn-color-primary-light, @cerulean);
        }
    }
    button[role="secondary"] {
        float: right;
        height: 34px;
        margin: 10px;
        background: var(--dnn-color-primary-contrast, @white);
        color: var(--dnn-color-primary, @curiousBlue);
        padding: 0 22px;
        border: 1px solid var(--dnn-color-primary, @curiousBlue);
        border-radius: 4px;
        cursor: pointer;
        &:hover, &:active {
            color: var(--dnn-collor-primary-light, @cerulean);
            border-color: var(--dnn-collor-primary-light, @cerulean);
        }
    }
    .date-input {
        span {
            float: left;
        }
        .select-container {
            overflow: hidden;
            position: absolute;
            width: 36px;
            right: 0px;
            height: 100%;
            top: 0;
            span {
                padding-top: 8px;
            }
            &:after {
                content: "";
                position: absolute;
                top: 14px;
                right: 5px;
                width: 0;
                height: 0;
                border-left: 4.88px solid transparent;
                border-right: 4.88px solid transparent;
                border-top: 4.34px solid var(--dnn-color-neutral, #6f7273);
                z-index: 2;
                pointer-events: none;
            }
            &, * {
                .prefixes(user-select, none);
            }
        }
        input[type="text"] {
            float: left;
            padding: 0px;
            min-width: 0;
            width: 20px;
            border: none;
            outline: none !important;
            text-align: center;
            background: transparent;
            &::-webkit-input-placeholder {
                font-size: 10px;
            }
            &.year {
                width: 40px;
            }
        }
    }
}

.dnn-time-picker-box {
    .dnn-time-picker {
        &.timezone-picker {
            text-align: left;
            width: 155px;
            .time-selector {
                width: 215px;
                .time-options {
                    width: 228px;
                }
            }
            .time-text {
                width: 150px;
                .time-text-label {
                    display: block;
                    width: 135px;
                    text-overflow: ellipsis;
                    white-space: nowrap;
                    overflow: hidden;
                }
            }
        }
        &.time-picker {
            &.half {
                text-align: left;
                width: 75px;
                .time-text {
                    width: 75px;
                }
            }
            &.full {
                text-align: center;
                width: 240px;
                .time-text {
                    width: 82px;
                    margin: auto;
                    padding: 8px 0 0 0;
                }
            }
            .time-selector {
                width: 134px;
                .time-options {
                    width: 147px;
                }
            }
        }
        
        
        float: left;
        border-top: 1px solid var(--dnn-color-neutral-light, @mercury);
        margin-left: 10px;
        pointer-events: none;
        .time-text {
            position: relative;
            color: var(--dnn-color-primary, @curiousBlue);
            font-weight: 600;
            letter-spacing: 1px;
            height: 16px;
            pointer-events: all;
            &:after {
                position: absolute;
                content: "";
                right: 0px;
                top: 13px;
                width: 0;
                height: 0;
                border-left: 3px solid transparent;
                border-right: 3px solid transparent;
                border-top: 4px solid var(--dnn-color-primary, @curiousBlue);
            }
            .time-selector {
                height: 132px;
                overflow: hidden;
                background: var(--dnn-color-background, white);
                position: absolute;
                left: 50%;
                transform: translate(-50%);
                top: 31px;
                border: 1px solid var(--dnn-color-neutral, @alto);
                padding: 5px 0px;
                box-sizing: border-box;
                box-shadow: 0px 0px 17px 2px rgba(0, 0, 0, .2);
                transition: @transition;
                opacity: 0;
                &.show {
                    opacity: 1;
                }
                .time-options {
                    overflow-y: scroll;
                    overflow-x: auto;
                    height: 100%;
                    .time-option {
                        color: var(--dnn-color-neutral, @rollingStone);
                        padding: 5px;
                        cursor: pointer;
                        &:hover {
                            background: var(--dnn-color-primary-contrast, @gallery);
                            color: var(--dnn-color-primary, @curiousBlue);
                        }
                    }
                }
            }
        }
    }
}